home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / emacs-complete / fsf / emacs / lisp / version.el < prev    next >
Lisp/Scheme  |  1994-10-05  |  3KB  |  78 lines

  1. ;;; version.el --- record version number of Emacs.
  2.  
  3. ;;; Copyright (C) 1985, 1992, 1994 Free Software Foundation, Inc.
  4.  
  5. ;; Maintainer: FSF
  6. ;; Keywords: internal
  7.  
  8. ;; This file is part of GNU Emacs.
  9.  
  10. ;; GNU Emacs is free software; you can redistribute it and/or modify
  11. ;; it under the terms of the GNU General Public License as published by
  12. ;; the Free Software Foundation; either version 2, or (at your option)
  13. ;; any later version.
  14.  
  15. ;; GNU Emacs is distributed in the hope that it will be useful,
  16. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. ;; GNU General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  22. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  
  24. ;;; Code:
  25.  
  26. (defconst emacs-version "19.28" "\
  27. Version numbers of this version of Emacs.")
  28.  
  29. (defconst emacs-major-version
  30.   (progn (string-match "^[0-9]+" emacs-version)
  31.      (string-to-int (substring emacs-version
  32.                    (match-beginning 0) (match-end 0))))
  33.   "Major version number of this version of Emacs.
  34. This variable first existed in version 19.23.")
  35.  
  36. (defconst emacs-minor-version
  37.   (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)
  38.      (string-to-int (substring emacs-version
  39.                    (match-beginning 1) (match-end 1))))
  40.   "Minor version number of this version of Emacs.
  41. This variable first existed in version 19.23.")
  42.  
  43. (defconst emacs-build-time (current-time-string) "\
  44. Time at which Emacs was dumped out.")
  45.  
  46. (defconst emacs-build-system (system-name))
  47.  
  48. (defun emacs-version  (&optional here) "\
  49. Return string describing the version of Emacs that is running.
  50. If optional argument HERE is non-nil, insert string at point.
  51. Don't use this function in programs to choose actions according
  52. to the system configuration; look at `system-configuration' instead."
  53.   (interactive "P")
  54.   (let ((version-string 
  55.          (format "GNU Emacs %s (%s%s) of %s %s on %s"
  56.                  emacs-version
  57.          system-configuration
  58.          (if (featurep 'x-toolkit) ", X toolkit" "")
  59.                  (substring emacs-build-time 0
  60.                             (string-match " *[0-9]*:" emacs-build-time))
  61.                  (substring emacs-build-time 
  62.                             (string-match "[0-9]*$" emacs-build-time))
  63.                  emacs-build-system)))
  64.     (if here 
  65.         (insert version-string)
  66.       (if (interactive-p)
  67.           (message "%s" version-string)
  68.         version-string))))
  69.  
  70. ;;; We hope that this alias is easier for people to find.
  71. (fset 'version 'emacs-version)
  72.  
  73. ;;Local variables:
  74. ;;version-control: never
  75. ;;End:
  76.  
  77. ;;; version.el ends here
  78.